#ifndef _DEFINE_H_
#define _DEFINE_H_


//use as net dll open
#ifndef USE_AS_NET_DLL
#define AS_DLL  
#else
#ifdef  DLL_EXPORT//C++预编译头
#define AS_DLL __declspec(dllexport)//设置为导出库
#else
#define AS_DLL __declspec(dllimport)//设置为导入库
#endif 
#endif

#include <thread>


static union { char c[4]; unsigned long mylong; } endian_test = { { 'l', '?', '?', 'b' } };
#define ENDIANNESS ((char)endian_test.mylong)
#define IS_LITTLE_ENDIAN (ENDIANNESS=='l')

#define BigLittleSwap32(A)  ((((uint32)(A) & 0xff000000) >> 24) | \
							(((uint32)(A) & 0x00ff0000) >> 8) | \
							(((uint32)(A) & 0x0000ff00) << 8) | \
							(((uint32)(A) & 0x000000ff) << 24))

#define BigLittleSwap16(A)  ((((uint16)(A) & 0xff00) >> 8) | (((uint16)(A) & 0x00ff) << 8))

namespace as
{
namespace inet
{
constexpr int SVC_MAX_EVENT_NUM = 1;
}
}
namespace as
{
namespace tool
{
	static inline void sleepms(int mstime)
	{
        std::this_thread::sleep_for(std::chrono::milliseconds(mstime));
	}

	static inline void sleep(int time)
	{
		std::this_thread::sleep_for(std::chrono::seconds(time));
	}
}
}



#endif

